package com.um.jdy.app.activity.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.um.jdy.app.activity.entity.dto.CouponsStationListQuery;
import com.um.jdy.app.activity.entity.vo.CouponsStationItemVO;
import com.um.jdy.app.activity.manager.CouponsStationManager;
import com.um.jdy.app.device.entity.vo.StationItemVO;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 控制器：优惠券站场关联表
 */
@RestController
@RequestMapping("/api/v1/coupons/station")
@Api(tags = "充电优惠券")
@SaCheckLogin
@Validated
public class CouponsStationController {

    @Autowired
    CouponsStationManager couponsStationManager;

    @ApiOperation(value = "查询充电优惠券可用站场")
    @GetMapping("available")
    public Response<Page<CouponsStationItemVO>> getAvailableStations(@Valid CouponsStationListQuery query) {

        return Response.success(couponsStationManager.getAvailableStations(query));
    }


}
